﻿using System;
using System.Collections.Generic;
using System.Text;
using TCKQKL.Service.DataContract;

namespace TCKQKL.DAL.IDAL
{
    public interface IOrdersOnline
    {
        void BeginADOTransaction();
        void RollBackTransaction();
        void CommitADOTransaction();
        void Open(string connString);
        void Close();

        OrdersOnlineModel getNewestOrder(string OrgStatus, string StatusAfter);
        OrdersOnlineModel GetOriginalOrder(int OrderPlaceId);
        OrdersOnlineModel GetOrderByOrderId(int OrderPlaceId);
        OrdersOnlineModel GetMostRecentOrder(string AccountNo, string OrderSide, DateTime OpenDate, DateTime ExpireDate, string Symbol, string Price, int Quantity, string TypeCancel);
        List<OrdersOnlineModel> getOrderListByStatus(string Status);
        List<OrdersOnlineModel> getOrderListByStatusAndAccountNo(string Status, string AccountNo);
        List<OrdersOnlineModel> getPendingOrdersByAccountNo(string AccountNo, string Status);
        List<OrdersOnlineModel> getOrderListDetail(string AccountNo, string OrderSide, string Symbol, string OrderSpec, string OrderClass, string OrderMode, DateTime TimeStamp, string Price, string OrderType, string OrderNo, int Quantity);

        int UpdateOrderStatus(int OrderPlaceId, string Status);
        int InsertNewOrder(OrdersOnlineModel order);
        int UpdateChangeOrder(int OrderPlacedId, string Price);
        int InsertChangeOrder(int OrderId, string OrderNo, DateTime TimeStamp, int Quantity, string Price, string OrderType);
        int InsertCancelOrder(int OrderId, string OrderNo, DateTime TimeStamp, int Quantity, string Price, string OrderType);
        void DeleteOrderByOrdePlacerId(int OrderPlaceId);
    }
}
